var fixExifDataStep=
{
	title:'Fix EXIF Data',
	createUI:function()
	{
		var ret=$('<div>'+
			'Copy file modify time to Exif time <button id="btnCopyFileModifyTimeToExifTime">Copy</button><br>'+
			'Geo-tag files<button id="btnGeoTag">Geo-Tag</button><br>'+
			'Launch Picasa<button id="btnLaunchPicasa">Launch</button>'+
			'</div>');
		return ret;
	},
	postCreateUI:function()
	{
		$('#btnCopyFileModifyTimeToExifTime').click(function(){
			
			var cmd='"'+Environment.binPath+'\\exiftool.exe" -if "not $dateTimeOriginal" "-FileModifyDate>DateTimeOriginal" "'+
				$('#txtAlbumPath').attr('value')+'"';
				
			var oExec=Shell.obj.Exec(cmd);
			var out=oExec.StdOut.ReadAll();
			var err=oExec.StdErr.ReadAll();

			
			alert('[out]'+out+'\n[err]'+err);
		});
	
		$('#btnGeoTag').click(function(){
			
			var cmd='"'+Environment.binPath+'\\exiftool.exe" -if "not $GPSLatitude" -geotag "'+
				$('#txtGpxPath').attr('value')+'" "'+
				$('#txtAlbumPath').attr('value')+'"';
				
			var oExec=Shell.obj.Exec(cmd);
			var out=oExec.StdOut.ReadAll();
			var err=oExec.StdErr.ReadAll();
			
			alert('[out]'+out+'\n[err]'+err);
		});

		$('#btnLaunchPicasa').click(function(){
			var cmd='"C:\\Program Files\\Google\\Picasa3\\Picasa3.exe" "'+$('#txtAlbumPath')+'"';
			Shell.exec(cmd);
		});
	}
};
	
stepManager.add(fixExifDataStep);
